<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script src="jslib/mustache.js"></script>
    <script>
        var templateStr1 = `
            <ul>
                {{#arr}}
                    <li>
                        <div class="hd">{{name}}的基本信息</div>    
                        <div class="bd">
                            <p>姓名：{{name}}</p>    
                            <p>性别：{{sex}}</p>    
                            <p>年龄：{{age}}</p>    
                        </div>
                    </li>
                {{/arr}}
            </ul>
        `;

        var templateStr2 = `
            <ul>
                {{#arr}}
                    <li>
                        {{name}}的爱好是：
                        <ol>
                            {{#hobbies}} 
                                <li>{{.}}</li>
                            {{/hobbies}} 
                        </ol>
                    </li>    
                {{/arr}}
            </ul>
        `;

        Mustache.render(templateStr2, {});
    </script>
</body>

</html>